package se.penselnsvag.bookdb.tech.log.imp
{
	import se.penselnsvag.bookdb.tech.log.LogManager;
	import se.penselnsvag.bookdb.tech.log.formater.IFormater;
	import se.penselnsvag.bookdb.tech.log.formater.SimpleFormater; 
	
	public class BaseLoggerImp {
	public function BaseLoggerImp(logLevel:Number,formater:IFormater)
		{
			this.logLevel = logLevel;
			if(formater==null)
			{
			
				this.formater = SimpleFormater.getInstance();
			
			}else{
			
				this.formater = formater;
			
			}
		}
		
		protected var logLevel:Number;
		protected var formater:IFormater;
		
		public function getLogLevel():Number {
			return logLevel;
		}
	
		
		public function debug(message:Object):void
		{
			tr(message, LogManager.DEBUG_LOG_LEVEL);
		}
	
		public function info(message:Object):void 
		{
			tr(message, LogManager.INFO_LOG_LEVEL);
		}
	
		public function warning(message:Object):void 
		{
			tr(message, LogManager.WARNING_LOG_LEVEL);	
		}
	
		public function error(message:Object):void 
		{
			tr(message, LogManager.ERROR_LOG_LEVEL);
		}
		
		public function fatal(message:Object):void
		{
			tr(message, LogManager.FATAL_LOG_LEVEL);
		}
		protected function tr(message:Object, level:int):void {
			//Abstract
		}
	}
}